<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>编辑用户信息</title>
	<link rel="stylesheet" type="text/css" href="../css/index.css"></link>
	<script src="../js/common.js"></script>
	<script src="../js/jquery.plugins/jquery.js"></script>
	<link rel="stylesheet" type="text/css" href="../js/jquery.plugins/easyui/css/default/easyui.css"></link>
	<link rel="stylesheet" type="text/css" href="../js/jquery.plugins/easyui/css/icon.css"></link>
	<script src="../js/jquery.plugins/easyui/jquery.easyui.min.js"></script>
	<script src="../js/myvalidatebox.js"></script>
	<script src="../js/jquery.plugins/easyui/easyui-lang-zh_CN.js"></script>
	<script>
		$(function(){
			$('#saveBtn').linkbutton({iconCls:'icon-save',text:"保存",plain:true});
			$('#resetBtn').linkbutton({iconCls:'icon-reload',text:"重置",plain:true});
			
			$("#oldpass").validatebox( {required:true,validType:"length[6,16]",missingMessage: "请输入旧密码",invalidMessage:"密码在6到16个字符以内。"});
			$("#newpass").validatebox( {required:true,validType:"length[6,16]",missingMessage: "请输入新密码",invalidMessage:"密码在6到16个字符以内。"});
			$("#renewpass").validatebox( {validType:"same['newpass']",invalidMessage:"确认密码与密码不匹配。"});
			
			$("form").submit(function(){
				if( checkValidate(["oldpass","newpass","renewpass"]) ){
					var param = "oldpass=" + $("#oldpass").val() 
						+ "&newpass=" + $("#newpass").val() + "&renewpass=" + $("#renewpass").val();
					jsonSend("savemypassword.ht",param,function(flag){
						if( flag == 0 ){
							errorMsg( "提示","旧密码错误" );
						}else if( flag == 1 ){
							infoMsg( "提示","修改成功" );
						}else if( flag == 2 ){
							errorMsg( "提示","修改失败" );
						}else if( flag == 3 ){
							errorMsg( "提示","新密码与确认密码不匹配" );
						}
					});
				}
				reset();
				return false;
			});
		});
	</script>
</head>
<body>
	<!-- 导航部分 -->
	<div class="position">
			您当前的位置：我的信息 &gt;&gt; 修改我的密码
			<span><a
			</span>
		</div>
	<!-- 导航部分结束 -->
	<!-- 表单部分开始 -->
	<div>
		<form action="save.ht" method="post">
			<input type="hidden" name="id" id="id" value="${model.id}"/>
			<table class="form" style="width:50%;">
				<tr>
					<td class="title">旧密码：</td>
					<td><input type="password" style="width:200px;"  id="oldpass" name="oldpass" value=""/></td>
				</tr>
				<tr>
					<td class="title">新密码：</td>
					<td><input type="password" style="width:200px;"  id="newpass" name="newpass" value=""/></td>
				</tr>
				<tr>
					<td class="title">确认密码：</td>
					<td><input type="password" style="width:200px;"  id="renewpass" name="renewpass" value=""/></td>
				</tr>
				<tr>
					<td colspan="2" class="btntd">
					<a href="javascript:commit();" id="saveBtn">保存</a>
					<a href="javascript:reset();" id="resetBtn">重置</a>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<!-- 表单部分结束  -->
</body>
</html>